Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Por qué obtengo "indefinido" después de exportar variables con Bash Script

Estoy tratando de exportar variables globales usando un script Bash para usar sus valores en mi API JS express . Aquí está mi código:

.../Backend/index.js:

 const express = require('express'); const app = express(); const root_folder = process.env.ROOT_FOLDER; app.get('/api', (req, res) => { res.send(root_folder); }); const port = process.env.PORT || 3000; app.listen(port, () => console.log(`Listening on port ${port}...`));

../Backend/ejecutar.sh:

 #!/usr/bin/env bash export ROOT_FOLDER="~/projects/Publishing_Platform" export PORT=5000

Después de ejecutar ./run.sh y ejecutar el script bash, ejecuto nodemon index.js pero todas las exportaciones dicen undefined . ¿Qué estoy haciendo mal?

¡Gracias por la ayuda!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!